﻿@model ShivamEMR.Model.Domain.PatientDomain.Patient
@{
    ViewBag.Title = "Create";
  
}
<h1>
    Edit</h1>
    <link href="@Url.Content("~/Content/Site.css")" rel="stylesheet" type="text/css" />
    <link href="@Url.Content("~/Content/themes/start/jquery-ui-1.8.20.custom.css")" rel="stylesheet" type="text/css" />
    <script src="@Url.Content("~/Scripts/jquery-1.7.2.min.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/jquery-ui-1.8.20.custom.min.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/modernizr-1.7.min.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/EditorHookup.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Content/selectBox.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Content/jquery.metro.js")" type="text/javascript"></script>
    <link href="@Url.Content("~/Content/jquery.metro.css")" rel="stylesheet" type="text/css" />
<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>
@using (Ajax.BeginForm("Edit", "Patient", null,
        new AjaxOptions
        {
            UpdateTargetId = "update-message",
            InsertionMode = InsertionMode.Replace,
            HttpMethod = "POST",
            OnSuccess = "updateSuccess"
        }, new { @id = "updatePForm" }))
{
    @Html.ValidationSummary(true)
    <div id="update-message" class="error invisible">
    </div>
    <div class='metro-pivot'>
        <div class='pivot-item'>
            <h3>
                Personal Details</h3>
            <table width="100%" cellpadding="4" cellspacing="4">
                <tr>
                    <td>
                        @Html.HiddenFor(model => model.ID)
                        <div class="editor-label">
                            @Html.LabelFor(model => model.Code)
                        </div>
                    </td>
                    <td>
                        <div class="editor-field">
                            @Html.EditorFor(model => model.Code)
                            @Html.ValidationMessageFor(model => model.Code)
                        </div>
                    </td>
                </tr>
                <tr>
                    <td>
                        <div class="editor-label">
                            @Html.LabelFor(model => model.Title)
                        </div>
                    </td>
                    <td>
                        <div class="editor-field">
                            @Html.EditorFor(model => model.Title)
                            @Html.ValidationMessageFor(model => model.Title)
                        </div>
                    </td>
                    <td>
                        <div class="editor-label">
                            @Html.LabelFor(model => model.FirstName)
                        </div>
                    </td>
                    <td>
                        <div class="editor-field">
                            @Html.EditorFor(model => model.FirstName)
                            @Html.ValidationMessageFor(model => model.FirstName)
                        </div>
                    </td>
                </tr>
                <tr>
                    <td>
                        <div class="editor-label">
                            @Html.LabelFor(model => model.MiddleName)
                        </div>
                    </td>
                    <td>
                        <div class="editor-field">
                            @Html.EditorFor(model => model.MiddleName)
                            @Html.ValidationMessageFor(model => model.MiddleName)
                        </div>
                    </td>
                    <td>
                        <div class="editor-label">
                            @Html.LabelFor(model => model.LastName)
                        </div>
                    </td>
                    <td>
                        <div class="editor-field">
                            @Html.EditorFor(model => model.LastName)
                            @Html.ValidationMessageFor(model => model.LastName)
                        </div>
                    </td>
                </tr>
                <tr>
                    <td>
                        <div class="editor-label">
                            @Html.LabelFor(model => model.AltFirstName)
                        </div>
                    </td>
                    <td>
                        <div class="editor-field">
                            @Html.EditorFor(model => model.AltFirstName)
                            @Html.ValidationMessageFor(model => model.AltFirstName)
                        </div>
                    </td>
                    <td>
                        <div class="editor-label">
                            @Html.LabelFor(model => model.AltMiddleName)
                        </div>
                    </td>
                    <td>
                        <div class="editor-field">
                            @Html.EditorFor(model => model.AltMiddleName)
                            @Html.ValidationMessageFor(model => model.AltMiddleName)
                        </div>
                    </td>
                </tr>
                <tr>
                    <td>
                        <div class="editor-label">
                            @Html.LabelFor(model => model.AltLastName)
                        </div>
                    </td>
                    <td>
                        <div class="editor-field">
                            @Html.EditorFor(model => model.AltLastName)
                            @Html.ValidationMessageFor(model => model.AltLastName)
                        </div>
                    </td>
                    <td>
                        <div class="editor-label">
                            @Html.LabelFor(model => model.DateOfBirth)
                        </div>
                    </td>
                    <td>
                        <div class="editor-field">
                            @Html.EditorFor(model => model.DateOfBirth)
                            @Html.ValidationMessageFor(model => model.DateOfBirth)
                        </div>
                    </td>
                </tr>
                <tr>
                    <td>
                        <div class="editor-label">
                            @Html.LabelFor(model => model.Barcode)
                        </div>
                    </td>
                    <td>
                        <div class="editor-field">
                            @Html.EditorFor(model => model.Barcode)
                            @Html.ValidationMessageFor(model => model.Barcode)
                        </div>
                    </td>
                    <td>
                        <div class="editor-label">
                            @Html.LabelFor(model => model.Sex)
                        </div>
                    </td>
                    <td>
                        <div class="editor-field">
                            @Html.DropDownListFor(model => model.SexID, ((IEnumerable<ShivamEMR.Model.Domain.PersonDomain.Sex>)ViewBag.PossibleSexes).Select(option => new SelectListItem
{
    Text = Html.DisplayTextFor(_ => option.SexName).ToString(),
    Value = option.ID.ToString(),
    Selected = (Model != null) && (option.ID == Model.SexID)
}), "Choose...")
                            @Html.ValidationMessageFor(model => model.SexID)
                        </div>
                    </td>
                </tr>
                <tr>
                    <td>
                        <div class="editor-label">
                            @Html.LabelFor(model => model.MaritalStatus)
                        </div>
                    </td>
                    <td>
                        <div class="editor-field">
                            @Html.DropDownListFor(model => model.MaritalSatusID, ((IEnumerable<ShivamEMR.Model.Domain.PersonDomain.MaritalStatus>)ViewBag.PossibleMaritalStatus).Select(option => new SelectListItem
{
    Text = Html.DisplayTextFor(_ => option.Status).ToString(),
    Value = option.ID.ToString(),
    Selected = (Model != null) && (option.ID == Model.MaritalSatusID)
}), "Choose...")
                            @Html.ValidationMessageFor(model => model.MaritalSatusID)
                        </div>
                    </td>
                    <td>
                        <div class="editor-label">
                            @Html.LabelFor(model => model.PersonStatus)
                        </div>
                    </td>
                    <td>
                        <div class="editor-field">
                            @Html.DropDownListFor(model => model.PersonStatusID, ((IEnumerable<ShivamEMR.Model.Domain.PersonDomain.PersonStatus>)ViewBag.PossiblePersonStatus).Select(option => new SelectListItem
{
    Text = Html.DisplayTextFor(_ => option.Status).ToString(),
    Value = option.ID.ToString(),
    Selected = (Model != null) && (option.ID == Model.PersonStatusID)
}), "Choose...")
                            @Html.ValidationMessageFor(model => model.PersonStatusID)
                        </div>
                    </td>
                    @*<td>

        <div class="editor-label">
            @Html.LabelFor(model => model.PictureID)
        </div>
</td>
<td>

        <div class="editor-field">
            @Html.EditorFor(model => model.PictureID)
            @Html.ValidationMessageFor(model => model.PictureID)
        </div>
</td>*@
                </tr>
                <tr>
                </tr>
            </table>
        </div>
        <div class='pivot-item'>
            <h3>
                Patient Details</h3>
            <table width="100%" cellpadding="4" cellspacing="4">
                <tr>
                    <td>
                        <div class="editor-label">
                            @Html.LabelFor(model => model.RegistrationDate)
                        </div>
                    </td>
                    <td>
                        <div class="editor-field">
                            @Html.EditorFor(model => model.RegistrationDate)
                            @Html.ValidationMessageFor(model => model.RegistrationDate)
                        </div>
                    </td>
                    <td>
                        <div class="editor-label">
                            @Html.LabelFor(model => model.RegisteredInBranch)
                        </div>
                    </td>
                    <td>
                        <div class="editor-field">
                            @Html.DropDownListFor(model => model.RegisteredInBranchID, ((IEnumerable<ShivamEMR.Model.Domain.CompanyDomain.Branch>)ViewBag.PossibleRegisteredInBranches).Select(option => new SelectListItem
{
    Text = (option == null ? "None" : option.Name),
    Value = option.ID.ToString(),
    Selected = (Model != null) && (option.ID == Model.RegisteredInBranchID)
}), "Choose...")
                            @Html.ValidationMessageFor(model => model.RegisteredInBranchID)
                        </div>
                    </td>
                </tr>
                <tr>
                    @*<td>

        <div class="editor-label">
            @Html.LabelFor(model => model.PersonAccountID)
        </div>
</td>
<td>

        <div class="editor-field">
            @Html.EditorFor(model => model.PersonAccountID)
            @Html.ValidationMessageFor(model => model.PersonAccountID)
        </div>
</td>*@
                </tr>
                <tr>
                </tr>
            </table>
        </div>
    </div>
    <p>
        <input type="submit" value="Save" />
    </p>
    
}
<div>
    @Html.ActionLink("Back to List", "Index")
</div>
<script>
    $(function () {
        $("div.metro-pivot").metroPivot();
    });
</script>
